import Vue from "vue";
import Vuex from "vuex";
import modules from "./modules";
import getters from "./getters";
import vuexalong from "vuex-persistedstate"
Vue.use(Vuex);
const debug = process.env.NODE_ENV !== "production";

export default new Vuex.Store({
	modules,
	getters,
	plugins: [
		vuexalong({
			storage: {
				getItem: key => uni.getStorageSync(key),
				setItem: (key, value) => uni.setStorageSync(key, value),
				removeItem: key => uni.removeStorageSync(key)
			}
		})
	],
	strict: debug
});